#!/bin/bash
function swap() # swap 2 filenames around
{
   if [[ -e "$1" && -e "$2" ]]      # if files exist
   then
      local TMPFILE=tmp.$$
      mv "$1" $TMPFILE
      mv "$2" "$1"
      mv $TMPFILE "$2"
   else
      echo "\e[1;31mError:\e[0m Make sure the files exist."
   fi
}
